﻿using B.S.Traceability.Domain;
using B.S.Traceability.Error;
using B.S.Traceability.Read.API.Application.Commends.Processs;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace B.S.Traceability.Read.API.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class ProcessController : ControllerBase
    {
        private readonly IMediator mediator;

        public ProcessController(IMediator mediator)
        {
            this.mediator = mediator;
        }



        /// <summary>
        /// 显示深加工信息
        /// </summary>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        /// 
        [HttpGet]
        public async Task<APIResult<List<Process>>> GetProcess([FromQuery]GetProcessCommends request, CancellationToken cancellationToken)
        {
            return await mediator.Send(request, cancellationToken);

        }
    }
}
